/*
 * data_buffer.c
 *
 *  Created on: Dec 8, 2012
 *      Author: andrey
 */

#include "data_buffer.h"
#include "rficonsole.h"

void initDataBuffer(data_buffer_s *db) {
	db->size = 0;
}

void addValue(data_buffer_s *db, int value) {
	if (db->size == MAX_SIZE)
		return;
	int s = db->size;
	db->elements[s] = value;
	db->size = s + 1;
}

void printDataBuffer(data_buffer_s *db, char *message) {
	int s = db->size;
	print("buffer [%s] size=%d\r\n", message, s);
	for (int i = 0; i < s; i++)
		print("%d: %d\r\n", i, db->elements[i]);
}

